﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using Newtonsoft.Json.Linq;

namespace FBEntities.FBObjects
{
    public class FBComments : IFBObject
    {
        public int count;
        public List<FBComment> data;
        public FBPaging paging;

        #region IFBObject Members
        
        public FBComments()
        {
            data = new List<FBComment>();
        }

        public void Parse(Newtonsoft.Json.Linq.JObject text)
        {
            FBParseUtilities.Parse(text, this);
        }

        #endregion
    }

    public class FBComment : IFBObject
    {
        public string id;
        public FBFrom from;
        public string message;
        public DateTime created_time;

        #region IFBObject Members

        public void Parse(Newtonsoft.Json.Linq.JObject text)
        {
            FBParseUtilities.Parse(text, this);
        }

        #endregion

        public FBPost ToPost()
        {
            FBPost ret = new FBPost();
            ret.id = id;
            ret.from = from;
            ret.message = message;
            ret.created_time = created_time;
            ret.type = "comment";

            return ret;
        }
    }

    public class FBPaging : IFBObject
    {
        public string previous;
        public string next;

        #region IFBObject Members

        public void Parse(Newtonsoft.Json.Linq.JObject text)
        {
            FBParseUtilities.Parse(text, this);
        }

        #endregion
    }

    public class FBStatus : IFBObject
    {
        #region IFBObject Members

        public string id;
        public FBFrom from;
        public string message;
        public DateTime updated_time;

        public void Parse(JObject text)
        {
            FBParseUtilities.Parse(text, this);
        }

        #endregion
    }

}
